Socrata Open Data API

Access government data programmatically through our simple REST API

Getting Started

Start exploring our API with these simple endpoints:

GET /api/views/results.json

Authentication

Use your API token to access protected endpoints:

POST /api/authenticate
Learn More

Example Query

const response = await fetch('https://data.cityofnewyork.us/resource/erm2-nwe9.json');
const data = await response.json();
console.log(data);

SDK Installation

Use our official SDK to simplify API interactions:

npm install soda-js

SDK Usage Example:

// Initialize the SDK
const soda = require('soda-js');
const consumer = new soda.Consumer('data.cityofnewyork.us');

// Make a query
consumer.query()
  .withDataset('erm2-nwe9')
  .limit(5)
  .where({ agency: 'NYPD' })
  .execute()
  .then(results => console.log(results));
View SDK Docs
2 days ago
5
JUSTIN_TIME
JUSTIN_TIME